# /usr/share/fonts/chinese/TrueType
from wordcloud import WordCloud
import os

FILE = os.path.dirname(__file__)
print("FILE", FILE)
font_path = os.environ.get('FONT_PATH', os.path.join(FILE, 'msyh.ttf'))
print("font_path", font_path)
wc = WordCloud(font_path=font_path)
# 词云的文本内容
text = "逆境清醒、Adversity Awake、https://blog.csdn.net/weixin_69553582、逆境清醒的博客_CSDN博客、python教程、前端特效实例、python turtle绘图、three.js、源码"
wc.generate(text)
# 将词云存为本地图片png格式
wc.to_file("p10.png")
